package com.mym.test;

/**
 * @author miao
 * @version 1.0
 * @date 2025/4/12 14:14
 * @description
 */
public abstract class Pet2 {
    private String name;
    private int heath;
    private int qinmi;

    public Pet2() {
    }

    public Pet2(String name, int heath, int qinmi) {
        this.name = name;
        this.heath = heath;
        this.qinmi = qinmi;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getHeath() {
        return heath;
    }

    public void setHeath(int heath) {
        this.heath = heath;
    }

    public int getQinmi() {
        return qinmi;
    }

    public void setQinmi(int qinmi) {
        this.qinmi = qinmi;
    }
    public abstract void show();
}
class Dog2 extends Pet2{
    private String type;

    public Dog2(String name, int heath, int qinmi) {
        super(name, heath, qinmi);
    }

    public Dog2(String name, int heath, int qinmi, String type) {
        super(name, heath, qinmi);
        this.type = type;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    @Override
    public void show() {
        System.out.println("宠物"+getName()+"的自白");
        System.out.println("我的名字叫"+getName()+",我的健康值："+getHeath()+",我和主人的亲密度："+getQinmi());
        System.out.println("我是一只"+getType());
    }
}
class Mei extends Pet2{
    private String type;

    public Mei(String name, int heath, int qinmi) {
        super(name, heath, qinmi);
    }

    public Mei(String name, int heath, int qinmi, String type) {
        super(name, heath, qinmi);
        this.type = type;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    @Override
    public void show() {
        System.out.println("宠物"+getName()+"的自白");
        System.out.println("我的名字叫"+getName()+",我的健康值："+getHeath()+",我和主人的亲密度："+getQinmi());
        System.out.println("我是一只"+getType());
    }
}
